package com.ashley.day_03;

import java.util.Scanner;
public class IfExer {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		System.out.println("请输入狗的年龄：");
		int dogAge = scan.nextInt();

		if (dogAge <= 2 && dogAge >= 0) {
			System.out.println("相当于人的年龄：" + (10.5 * dogAge));
		} else if (dogAge > 2) {
			System.out.println("相当于人的年龄：" + (10.5 * 2 + (dogAge - 2) * 4));
		} else {
			System.out.println("狗的年龄不合法!");
		}

	}

}
